﻿using Gumini.JulaDB.DataTypes;

namespace Gumini.JulaDB.Expressions.Operators
{
    internal class MinusOperator : UnaryOperator
    {
        public MinusOperator()
            : base("-") { }
    
        public override TypedValue Evaluate(TypedValue arg)
        {
            decimal value = (decimal)arg.Value;
            return new TypedValue(arg.Type, -value);
        }

        public override DataType GetReturnType()
        {
            return DataType.Number;
        }
    }
}
